#
#Copyright (c) 2024 Black Sesame Technologies
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
#

objs := lwrb/lwrb.o lwrb/lwrb_ex.o sq_buffer/sq_buffer.o \
hscg_firmware.o FlexCAN_Ip.o can_input.o can_output.o route.o can_config.o eth2can.o can_ipc.o can_msg.o can_txqueue.o\
hscg_firmware_statistic.o vcan.o gmac_time.o

# debug statistics
ifeq ($(CONFIG_STATISTICS_CODE_TIMESTAMP), y)
objs += hscg_firmware_code_statistic.o
endif
ifeq ($(CONFIG_STATISTICS_PACKET_TIMESTAMP), y)
objs += hscg_firmware_packet_statistic.o
endif
MODULE_CFLAGS := -I $(TOP_DIR)/library/
MODULE_CFLAGS += -I $(TOP_DIR)/modules/hscg_flexcan/

MODULE_CFLAGS += -Werror -Wno-incompatible-pointer-types -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast

all: $(objs)
	
%.o:%.c
	${CC} $(CPPFLAGS) $(CFLAGS) $(MODULE_CFLAGS) -c -o $(OBJ_DIR)/$(notdir $@) $<
